/**
 * Created by 游永年 on 2019-01-12 14:28.
 * 商品列表单体中间显示标题和描述的部份
 */

'use strict'
import React from 'react';
import {Flex} from "antd-mobile";

class Pcenter extends React.Component {
  constructor(props) {
    super(props);
    this.state = {};
  }

  render() {
    const {
      teacher: {teacherName = '', teachAge = 0, hasTeachNum = 0} = {},
      banji: {stuNum = 0, baomingNum} = {},
      classInfShow = true,
    } = this.props;
    const labels = ['优秀老师', `${teachAge || 0}年教龄`, `已授${hasTeachNum || 0}课`];
    const classInf = `${stuNum || 0}人班,已报名${baomingNum || 0}人`;

    return (
      <Flex direction={"column"} justify={'between'} align={'start'} style={{height: "100%", flexGrow: 1}}>
        <div
          style={{
            color: '#888',
            fontSize: 16,
            borderBottom: '1px solid #F6F6F6',
          }}
        >{teacherName || ''}
        </div>
        <div style={{lineHeight: 1}}>
          {labels.join('|')}
        </div>
        <div style={{alignSelf: 'end'}}>
          {classInfShow && classInf}
        </div>
      </Flex>
    );
  }
}

Pcenter.propTypes = {};

export default Pcenter;
